//
//  UICollectionView+YCTools.m
//  Pods
//
//  Created by Apple on 2022/11/3.
//

#import "UICollectionView+YCTools.h"

@implementation UICollectionView (YCTools)

+ (UICollectionView *)collectionViewWithFrame:(CGRect)frame
                                     delegate:(id)delegate
                                   dataSource:(id)dataSource {
    return [self collectionViewWithFrame:frame bgColor:UIColor.clearColor layout:[UICollectionViewFlowLayout new] delegate:delegate dataSource:dataSource];
}

+ (UICollectionView *)collectionViewWithFrame:(CGRect)frame
                                      bgColor:(UIColor *)bgColor
                                     delegate:(id)delegate
                                   dataSource:(id)dataSource {
    return [self collectionViewWithFrame:frame bgColor:bgColor layout:[UICollectionViewFlowLayout new] delegate:delegate dataSource:dataSource];
}

+ (UICollectionView *)collectionViewWithFrame:(CGRect)frame
                                       layout:(UICollectionViewFlowLayout *)layout
                                     delegate:(id)delegate
                                   dataSource:(id)dataSource {
    return [self collectionViewWithFrame:frame bgColor:UIColor.clearColor layout:layout delegate:delegate dataSource:dataSource];
}

+ (UICollectionView *)collectionViewWithFrame:(CGRect)frame
                                      bgColor:(UIColor *)bgColor
                                       layout:(UICollectionViewFlowLayout *)layout
                                     delegate:(id)delegate
                                   dataSource:(id)dataSource {
    UICollectionView *collectionView = [[UICollectionView alloc] initWithFrame:frame collectionViewLayout:layout];
    collectionView.backgroundColor = bgColor;
    collectionView.dataSource = dataSource;
    collectionView.delegate = delegate;
    return collectionView;
}

@end
